{extend name="public/base" /}

{block name="title"}<title>{$Think.lang.list}</title>{/block}

{block name="pjax_container"}
<section class="content-header">
    <h1>评论列表</h1>
    <ol class="breadcrumb">
        <li class="active"><i class="fa fa-dashboard"></i> 评论列表</li>
    </ol>
</section>
<section class="content">
    <div class="row">
        <div class="col-md-12">
            <div class="box box-primary">
                <div class="box-header with-border">
                    <h3 class="box-title"></h3>
                    <div class="pull-left">
                        {:authAction(CONTROLLER_NAME.'/delete', 'delete_all')}
                    </div>
                    {include file="public/search" /}
                </div>
                <div class="box-body table-responsive">
                    <table class="table table-bordered table-hover table-sort">
                        <tr>
                            <th width="35"><input type="checkbox" class="minimal checkbox-toggle"></th>
                            <th>评论ID</th>
                            <th>场馆名称</th>
                            <th>评论账号</th>
                            <th>评论昵称</th>
                            <th>评论星级</th>
                            <th>评论内容</th>
                            <th>评论时间</th>
                            <th width="124">{$Think.lang.action}</th>
                        </tr>

                        {if condition="empty($dataList)"}
                        目前目前暂无评论
                        {else/}

                        {volist name="dataList" id="vo"}
                        <tr>
                            <td><input type="checkbox" name="id[]" value="{$vo.id}" class="minimal"></td>
                            <td>{$vo.id}</td>
                            <td>{$vo.designation}</td>
                            <td>{$vo.telphone}</td>
                            <td>{$vo.nickname}</td>
                            <td>
                              {if condition="($vo.grade == 0)"}
                                <img src="/api/images/star1.png" alt="">
                              {elseif condition="$vo.grade eq 1"/}
                                <img src="/api/images/star2.png" alt="">
                              {elseif condition="$vo.grade eq 2"/}
                                <img src="/api/images/star3.png" alt="">
                              {elseif condition="$vo.grade eq 3" /}
                                <img src="/api/images/star4.png" alt="">
                              {else}
                              <img src="/api/images/star5.png" alt="">
                              {/if}
                            </td>
                            <td>{$vo.content}</td>

                            <td>{$vo.evaluation_time}</td>

                            <td width="200">

                            {include file="public/list_action" /}

                            </td>
                        </tr>
                        {/volist}
                        {/if}
                    </table>
                </div>
                <div class="box-footer clearfix">
                </div>
            </div>
        </div>
    </div>
</section>
<script type="text/javascript">
$(function(){
    /*ajax页面加载icheck，有该控件的页面才需要*/
    $('input[type="checkbox"].minimal, input[type="radio"].minimal').iCheck({
        checkboxClass: 'icheckbox_minimal-blue',
        radioClass: 'iradio_minimal-blue'
    });

    /*ajax页面加载icheck，有该控件的页面才需要*/
    $(".select2").select2({language:"zh-CN"});

    /*全选-反选*/
    $('.checkbox-toggle').on('ifChecked', function(event){
        var _this = $(this);
        var _table = _this.closest('.table');
        _table.find("tr td input[type='checkbox']").iCheck("check");
    });
    $('.checkbox-toggle').on('ifUnchecked', function(event){
        var _this = $(this);
        var _table = _this.closest('.table');
        _table.find("tr td input[type='checkbox']").iCheck("uncheck");
    });

    {if condition=" $rest_login == 1 "}
    restlogin('{$rest_login_info}');   //登录超时
    {/if}
})
</script>
{/block}